Analog to Digital Conversion
Speak into your microphone. The simulation records real PCM samples from your audio codec and converts them in front of you.
This simulation reads real PCM samples from your sound card and converts them for real. Your browser will ask for microphone permission when you press Capture.
Drag to orbit the 3D view, scroll to zoom, and use Fit view to frame everything again. On a phone, the tabs along the bottom switch between panels.
All audio processing and speech recognition happen locally in your browser. No audio is sent to any server. The lab starts silently — press Voice Tour if you want narration.
Speak into your microphone. The simulation records real PCM samples from your audio codec and converts them in front of you.
Orig. Loudness
- dBFS
Quant. Loudness
- dBFS
Peak (raw)
-
Speed of Sound
343 m/s
Analog vs Digital Waveform
Frequency Spectrum (FFT)
Analog-to-Digital Conversion is the process of converting a continuous analog signal, like the sound of your voice, into a discrete digital signal that a computer can understand and process. This is fundamental to all modern digital audio. The process involves three main steps: Sampling, Quantization, and Encoding.
Sampling is the first step, where we take snapshots of the analog signal at regular, discrete intervals of time. The rate at which we take these snapshots is called the Sampling Rate (fs). In this simulation, you control the 'Number of Samples' taken over the analysis window.
Ts = 1/fs.xa(nTs), which means the value of the analog signal xa at the time of the n-th sample.After sampling, each sample still has a continuous amplitude. Quantization approximates this continuous amplitude to the nearest value from a finite set of discrete levels. The precision of this step is determined by the number of Quantization Bits (N).
L = 2N.24 = 16 distinct levels.Δ = Vrange / L, where Vrange is the total possible voltage or amplitude range of the signal.In the final step, each quantized level is assigned a unique binary code. With N bits, we can represent L = 2N levels. The simulation shows this binary string for each sample in the 3D view and the digital stream output.
Everything you see here is driven by genuine samples from your machine's audio codec — the ADC chip on your sound card, laptop board or USB microphone. The panel on the left reports what that chip negotiated with your operating system:
The browser hands those samples over as 32-bit floating point numbers between -1.0 and +1.0, already converted from the codec's native integer PCM. The 'Quantization Bits' slider then re-quantizes that real signal down to N bits so you can hear and see exactly what precision loss sounds like.
Nothing on this page is a stand-in for conversion. The full signal path is:
The Export .wav button writes a genuine RIFF/WAVE file at the decimated rate, carrying values snapped to your N-bit grid — open it in Audacity and the quantization steps are physically in the file.
The entire process can be summarized by the formula you see on the control panel:
xd[n] = Q(xa(nTs))
This means the n-th sample of the final digital signal (xd[n]) is the result of applying the Quantization function (Q) to the sampled analog signal (xa(nTs)).
For a full-scale signal the theoretical best case is:
SQNR ≈ 6.02 N + 1.76 dB
The panel shows this theoretical figure alongside the SQNR actually measured from your recorded voice, so you can see how close real speech gets to the ideal.
The simulation also calculates the speed of sound based on the air temperature you set. The approximate formula used is:
v ≈ 331.3 + 0.606 × T
Where 'v' is the speed in meters per second (m/s) and 'T' is the temperature in degrees Celsius (°C).